//
//  ThirdViewController.m
//  UI大结局_消息通知
//
//  Created by dllo on 15/12/10.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "ThirdViewController.h"

@interface ThirdViewController ()

@end

@implementation ThirdViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor greenColor];
    
    self.navigationItem.title = @"第三页";
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(50, 150, 50, 30);
    [button setTitle:@"约!" forState:UIControlStateNormal];
    button.backgroundColor = [UIColor lightGrayColor];
    [button addTarget:self action:@selector(buttonAction) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    
    
    
    
}

- (void)buttonAction
{
//    // 发送消息通知
//    [[NSNotificationCenter defaultCenter] postNotificationName:@"天王盖地虎" object:nil];
    
    // 发送带参数的消息通知
    [[NSNotificationCenter defaultCenter] postNotificationName:@"小鸡炖蘑菇" object:[UIColor magentaColor]];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
